package cn.edu.just.firstjavaapp.l3;

public class BitOptrDemo {
    public static void main(String[] args) {
        byte b1 =  0b1001110;
        byte b2 = 0b00111000;
        int c = b1&b2;
        System.out.println(Integer.toBinaryString(b1));
        System.out.println(Integer.toBinaryString(b2));
        System.out.println(Integer.toBinaryString(c));

        System.out.println("-------------------");
        c = b1|b2;
        System.out.println(Integer.toBinaryString(b1));
        System.out.println(Integer.toBinaryString(b2));
        System.out.println(Integer.toBinaryString(c));
        System.out.println("-------------------");
        c = b1^b2;
        System.out.println(Integer.toBinaryString(b1));
        System.out.println(Integer.toBinaryString(b2));
        System.out.println(Integer.toBinaryString(c));
    }
}
